#ifndef		__LOGGER_H_INCLUDED__
#define		__LOGGER_H_INCLUDED__

#define		LOG_DEBUG(pFmt, ...)	Logger::Instance().Log(ELog::Debug, pFmt, ##__VA_ARGS__)
#define		LOG_INFO(pFmt, ...)		Logger::Instance().Log(ELog::Info, pFmt, ##__VA_ARGS__)
#define		LOG_WARN(pFmt, ...)		Logger::Instance().Log(ELog::Warning, pFmt, ##__VA_ARGS__)
#define		LOG_ERR(pFmt, ...)		Logger::Instance().Log(ELog::Error, pFmt, ##__VA_ARGS__)

#include	<string>
#include	<mutex>

namespace ELog {
	enum Level {
		Error = 0,
		Warning,
		Info,
		Debug
	};
}

class Logger {
public:
	Logger();
	virtual ~Logger();
	
	static Logger &	Instance();
	void			Log(ELog::Level emLevel, const char * pFmt,	...);

private:
	FILE *			_pFile;
	char *			_pBuf;
	int				_nLastDay;
	std::mutex		_iLock;
};

#endif//!	__LOGGER_H_INCLUDED__